const express = require("express");
const router = express.Router();
const {
  getAsyncRoutes,
  update,
  del,
  add,
  details,
  all,
  list,
} = require("../../controllers/system/menusController");

/**
 * 查询所有菜单信息
 * GTE  /menus/list
 */
router.get("/list", list);

/**
 * 获取所有列表数据
 * GET /all
 */
router.get("/all", all);

/**
 * 查询菜单详情
 * GET /menus/details
 */
router.get("/details", details);

/**
 * 新增菜单
 * POST /menus/add
 */
router.post("/add", add);

/**
 * 删除菜单
 * DELETE /menus/delete
 */
router.delete("/delete", del);

/**
 * 更新菜单
 * PUT /menus/update
 */
router.put("/update", update);

/**
 * 获取动态路由
 * PUT /menus/getAsyncRoutes
 */
router.get("/getAsyncRoutes", getAsyncRoutes);

module.exports = router;
